package cn.sumpu.app.guoguojie.constant;

import java.util.HashMap;
import java.util.Map;

public enum FamilyRole {

	FATHER("01", "爸爸"), MOTHER("02", "妈妈"), SON("03", "儿子"), DAUTGHER("04",
			"女儿"), BABY("05", "宝宝");

	private String value;
	private String label;

	private static Map<String,String> cache;
	
	static {
		cache = new HashMap<String,String>();
		cache.put(FATHER.getValue(), FATHER.getLabel());
		cache.put(MOTHER.getValue(), MOTHER.getLabel());
		cache.put(SON.getValue(), SON.getLabel());
		cache.put(DAUTGHER.getValue(), DAUTGHER.getLabel());
		cache.put(BABY.getValue(), BABY.getLabel());
	}
	
	private FamilyRole(String value, String label) {
		this.value = value;
		this.label = label;
	}

	public String getValue() {
		return value;
	}

	public String getLabel() {
		return label;
	}
	
	public static String getLabelByValue(String value) {
		return cache.get(value);
	}
}
